#include<stdio.h>

int  squareByValue(int );
int squareByReferece(int *);
int main()
{
  int x=2;
  int z=4;
 
  printf("\n value before call squareByValue %d",x);
  printf("\n value returned by squareByValue %d",squareByValue(x));
  printf("\n value after calling squareByValue %d",x);

  printf("\n value before call squareByReference %d",z);
  printf("\n value returned by squareByReferebce %d",squareByReference(&z));
  printf("\n value after calling squareByReference %d \n",z);
 return 0;
}

 int squareByValue (int number)
 {
   return number *=number; //can not be modified
 }
 int squareByReference(int *numberRef)
 {
   return *numberRef *=*numberRef; //can be modified
 }
